import QtQuick 2.15
import QtQuick.Layouts 1.15
import QtQuick.Controls 2.15
import QtQuick.Window 2.15
import QtQuick.Shapes 1.15
import FluentUI 1.0
import "qrc:/component"
import "qrc:/global"

FluPage{

    id:team_page
    Flipable
    {
        id:flipable
        anchors.fill: parent
        Item
        {
            id:page_front
            visible:true
            anchors.fill:flipable
            FluNavigationView
            {
                property int clickCount: 0
                id:navi_view
                width: parent.width
                height: parent.height
                z:999
                //Stack模式，每次切换都会将页面压入栈中，随着栈的页面增多，消耗的内存也越多，内存消耗多就会卡顿，这时候就需要按返回将页面pop掉，释放内存。该模式可以配合FluPage中的launchMode属性，设置页面的启动模式
                //pageMode: FluNavigationViewType.Stack
                //NoStack模式，每次切换都会销毁之前的页面然后创建一个新的页面，只需消耗少量内存，可以配合FluViewModel保存页面数据（推荐）
                pageMode: FluNavigationViewType.NoStack
                items: TeamsOriginal
                navCompactWidth: 60
                //hideNavAppBar: true
                displayMode:FluNavigationViewType.auto
                //topPadding:FluTools.isMacos() ? 20 : 0
                //displayMode:viewmodel_settings.displayMode
                autoSuggestBox:FluAutoSuggestBox
                {
                    iconSource: FluentIcons.Search
                    items: TeamsOriginal.getSearchData()
                    placeholderText: Lang.search
                    onItemClicked:
                        (data)=>
                        {
                            TeamsOriginal.startPageByItem(data)
                        }
                }
                Component.onCompleted:
                {
                    TeamsOriginal.navigationView = navi_view
                    setCurrentIndex(0)
                }
            }
        }
    }
}
